package com.example.vv.config;

import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@RocketMQMessageListener(topic = "wangdehai", consumerGroup = "wangdehai")
public class MyConsumer1 implements RocketMQListener<String> {

    public MyConsumer1() {
        System.err.println("myconsumer1.");
    }

    public void onMessage(String message) {
        System.err.println(message);
        throw new RuntimeException("消费失败");
    }
}
